package com.training.java.core.collections;


import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class ListDemo {

	public static void main(String[] args) {
		
		List<String> list = new ArrayList<String>();
		
		list.add("Siva");
		list.add("Satya");
		list.add("Rheenu");
		list.add("Raji");
		list.add("Jaya");
		
		//reading from the list
		
		Iterator<String> ite = list.iterator();
		
		while (ite.hasNext()){
			String studentName = ite.next();
			
			System.out.println(" Student Name : " + studentName);
		}
		
		System.out.println("   ");
		
		for (String studentName : list) {
			System.out.println("Student Name :" + studentName );	
			
		}
			
		}
		
		
		
		
		
	}


